Skip to content

remove narrowing conversion in random.hpp#497

Merged
Becheler merged 1 commit into
boostorg:developfrom
Becheler:fix/random-hpp-size-t-narrowing
Jun 8, 2026
Merged

remove narrowing conversion in random.hpp#497
Becheler merged 1 commit into
boostorg:developfrom
Becheler:fix/random-hpp-size-t-narrowing

Conversation

@Becheler

@Becheler Becheler commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Refs #496

Before submitting

  • This PR targets the develop branch.
  • I searched for an existing PR or issue covering the same change.
  • My contribution is licensed under the Boost Software License 1.0.

Type of change

  • Bug fix
  • New feature or API addition
  • Refactor (no behavior change)
  • Documentation
  • Build, CI, or tooling
  • Other (specify below)

Does this PR introduce a breaking change?

  • Yes (describe migration impact below)
  • No

What this PR does

Remove narrowing conversion in random header.

Motivation

Parameterize uniform_int on the graph's size_type to remove the size_t > int narrowing in random_vertex/random_edge, clearing the MSVC C4267 warnings and fixing latent truncation for graphs larger than INT_MAX.

Testing

Same CI, less warnings:

Job Baseline (develop) After fix Δ
MSVC 14.3 1226 1097 −129
ubuntu gcc-14 (14/17/20/23) 51 51 0
ubuntu clang-19 (14/17/20/23) 75 75 0
macOS clang 14 75 75 0
macOS clang 17 70 70 0
macOS clang 20 70 70 0
all cmake jobs 0 0 0

Checklist

  • Existing tests pass (b2 in the test/ directory).
  • New behavior is covered by a test, or this is a docs / build / refactor change.
  • Documentation was updated if user-facing behavior changed.
  • No new compiler warnings on the platforms I built against.

@Becheler Becheler self-assigned this Jun 6, 2026
@Becheler Becheler force-pushed the fix/random-hpp-size-t-narrowing branch from a5316a0 to c1ed7ec Compare June 6, 2026 11:35
@Becheler Becheler marked this pull request as ready for review June 6, 2026 12:07
@Becheler Becheler requested a review from jeremy-murphy as a code owner June 6, 2026 12:07
@Becheler Becheler changed the title remove narrowing conversion remove narrowing conversion in random.hpp Jun 6, 2026
@Becheler Becheler added the priority: high Blocks users or core functionality. Needs attention in the current cycle. label Jun 6, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 27061202843 vs develop run 27113717212 (c1ed7eca2a).

Job Baseline After Delta
macos (clang, 14) 75 75 0
macos (clang, 17) 70 70 0
macos (clang, 20) 70 70 0
ubuntu (clang-19, 14) 75 75 0
ubuntu (clang-19, 17) 75 75 0
ubuntu (clang-19, 20) 75 75 0
ubuntu (clang-19, 23) 75 75 0
ubuntu (gcc-14, 14) 51 51 0
ubuntu (gcc-14, 17) 51 51 0
ubuntu (gcc-14, 20) 51 51 0
ubuntu (gcc-14, 23) 51 51 0
windows_msvc_14_3 (msvc-14.3) 1226 1097 -129

@Becheler Becheler merged commit fe3ac07 into boostorg:develop Jun 8, 2026
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high Blocks users or core functionality. Needs attention in the current cycle. warning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant